﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace mal.balades.Business.Log
{
    public class MalLogManager
    {
        private ILog businessLogger = null;
        private ILog adminLogger = null;
        private ILog webLogger = null;
        private ILog errorLogger = null;

        private static MalLogManager logManager = null;

        private MalLogManager()
        {
            adminLogger = LogManager.GetLogger("Admin");
            businessLogger = LogManager.GetLogger("Business");
            webLogger = LogManager.GetLogger("Web");
            errorLogger = LogManager.GetLogger("Error");
        }

        private static MalLogManager Instance
        {
            get
            {
                if (MalLogManager.logManager == null)
                    MalLogManager.logManager = new MalLogManager();
                return MalLogManager.logManager;
            }
        }

        public static ILog BusinessLogger
        {
            get
            {
                return MalLogManager.Instance.businessLogger;
            }
        }

        public static ILog AdminLogger
        {
            get
            {
                return MalLogManager.Instance.adminLogger;
            }
        }

        public static ILog WebLogger
        {
            get
            {
                return MalLogManager.Instance.webLogger;
            }
        }

        public static ILog ErrorLogger
        {
            get
            {
                return MalLogManager.Instance.errorLogger;
            }
        }
    }
}
